package raytracing;

public class TraceDepth {
	public int diff;
	public int refl;
	public int refr;
	public boolean initialized;
	
	/**
	 * 
	 * @param diff Numero de rayos diffuse
	 * @param refl Numero de rebotes a tomar para rayos de reflejo
	 * @param refr Numero de rayos transmitidos por refraccion
	 */
	
	public TraceDepth(int diff, int refl, int refr) {
		if (diff <= 0 || refl <= 0 || refr <= 0) {
			throw new IllegalArgumentException("invalid depths");
		}
		
		this.diff = diff;
		this.refl = refl;
		this.refr = refr;
		initialized = true;
	}
	
	public int[] getDepths() {
		int[] depths = {0, 0, 0};
		
		if (initialized) {
			depths[0] = diff;
			depths[1] = refl;
			depths[2] = refr;
		} else {
			depths[0] = 1;
			depths[1] = 4;
			depths[2] = 4;
		}
			return depths;
	}
}
